
// function makeSpliter(spliter:HTMLElement,leftElem:HTMLElement,rightElem:HTMLElement,opts:{minLeft?:number,minRight?:number}){
//     //寻找元素原来的某个式样的值
//     spliter.style.position="relative";
//     if(!leftElem) leftElem = spliter.firstElementChild as HTMLElement;
//     if(!rightElem) rightElem = spliter.lastElementChild as HTMLElement;

//     let spliterLine = document.createElement("div");
//     spliterLine.id="main-spliter";
//     let cssText = "opacity:0.005; position:absolute;width:3px;background-color:white;height:"+spliter.clientHeight +
//     "px;top:0;left:"+(leftElem.offsetLeft + leftElem.clientWidth)+"px;cursor:ew-resize";
//     spliterLine.style.cssText  = cssText;
//     spliter.appendChild(spliterLine);



//     spliterLine.onmousedown = (e)=>{
//         let mask = document.createElement("div");
//         mask.style.cssText ="position:absolute;left:0;top:0;width:"+document.body.clientWidth+"px;height:"+document.body.clientHeight+"px;background-color:white;opacity:0.005;";
//         document.body.appendChild(mask);
//         leftElem.style.width = leftElem.clientWidth + "px";
//         let x0;//y0;
//         mask.onmousemove = (e)=>{
//             if(x0===undefined){
//                 x0 = e.offsetX;
//                 //y0 = e.offsetY;
//                 return;
//             }
//             let difx = e.offsetX - x0;//dify;
//             let x = parseInt(spliterLine.style.left) + difx;
//             if(x<opts.minLeft)x =20;
//             if(x>spliter.clientWidth-opts.minRight) x = spliter.clientWidth-opts.minRight;//display
//             let left = x+"px";
//             spliterLine.style.left = left;
//             leftElem.style.width = parseInt(leftElem.style.width) + difx +"px";
            
//             x0 = e.offsetX;
//         };
//         mask.onmouseup=(e)=>{
//             document.body.removeChild(mask);
//         }
//     }
// }
